package com.yx.china.project.api;


import com.yx.china.project.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
public class PayApi {

    @Resource
    private PayService payService;
    @GetMapping(value = "/pay/ok/{id}")
    public String paymentInfo_OK(@PathVariable("id") Integer id){
        String result = payService.paymentInfo_OK(id);
        log.info("*****result："+result);
        return result;
    }
    @GetMapping(value = "/pay/timeout/{id}")
    public String paymentInfo_TimeOut(@PathVariable("id") Integer id){
        String result = payService.paymentInfo_Timeout(id);
        log.info("*****result："+result);
        return result;
    }

    //服务熔断
    @GetMapping(value = "/pay/break/{id}")
    public String paymentCircuitBreaker(@PathVariable("id") Integer id){
        String result = payService.paymentCircuitBreaker(id);
        log.info("*****result："+result);
        return result;
    }


}
